<template>
  <div class="bg">
    <div class="content bg4">

      <template v-if="title">
        <text class="font34 text1 tCenter">{{title}}</text>
        <div class="height50"></div>
      </template>
      <text class="text text2">{{text}}</text>
      <div class="height50"></div>

      <template v-if="yes || no">
        <div class="line-l bg2"></div>
        <div class="row">
              <div class="but" v-if="no" @click="click(true)">
                <text class="font34 text3">{{no}}</text>
              </div>
            <div class="line-v bg2" v-if="no && yes"></div>
            <div class="but" v-if="yes" @click="click(false)">
              <text class="font34 main-t1">{{yes}}</text>
            </div>
        </div>
      </template>
      </div>
  </div>
</template>

<style src="@/_css/style.css" ></style>
<style scoped>
.bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;

  justify-content: center;
  align-items: center;
  background-color: rgba(12, 12, 12, 0.8);
}
.content {
  width: 600px;
  border-radius: 24px;
  padding-top: 50px;
  padding-left: 40px;
  padding-right: 40px;
}
.text {
  font-size: 28px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  line-height: 50px;
  letter-spacing: 1px;
}
.line-l {
  height: 1px;
  margin-left: -40px;
  margin-right: -40px;
}
.line-v {
  width: 1px;
  height: 90px;
}
.but {
  flex: 1;
  align-items: center;
  justify-content: center;
  height: 90px;
}
</style>

<script>

//功能
import config from "@/_js/config";
import jnavigator from "@/_js/navigator";
import jdebug from "@/_js/debug";

import I18N from "@/_i18n/i18n";
var T = I18N.t;
export default {
  //变量
  data() {
    return {
      T:T,
      config:config,

      title:'',
      text:'',
      no:T('取消'),
      yes:T('确认'),
      dismiss:true
    }
  },

  //释放前
  beforeDestroy() {
  },

  //渲染前
  created() {
    var param = weex.config;
    this.title = param.title;
    this.text = param.text;
    this.no = param.no;
    this.yes = param.yes;
    this.dismiss = param.dismiss == undefined ? this.dismiss : param.dismiss;
  },

  //方法
  methods: {
    /************************** 点击*/
    click(bol) {
      this.$emit("click", bol);
      this.dismiss && jnavigator.dismiss();
    }
  },
};
</script>
